Datos

Aspecto:

env_results %>% head
##   channel id mon day   yr  Nitrogen Phosphorus flo_out    precip      evap
## 1       1  1   1  31 2000 1.137e+04  4.232e+02 272.700  1.529000 3.022e+06
## 2       5  8   1  31 2000 1.069e+04  4.231e+02 272.200  1.568000 1.215e+00
## 3       8 14   1  31 2000 1.060e+04  4.230e+02 272.000  7.111000 2.098e+07
## 4      13 33   1  31 2000 1.059e+04  4.229e+02 270.000 13.250000 2.169e+07
## 5      18 51   1  31 2000 3.291e+00  3.268e+02 202.800  2.908000 2.285e+00
## 6      25 67   1  31 2000 9.935e-01  2.202e-03   1.348  0.002365 1.051e-02
##     date_env P_Concentration N_Concentration scenario subbasin
## 1 2000-01-31    1.796167e-02    0.4825714053      sc1       13
## 2 2000-01-31    1.799041e-02    0.4545439083      sc1       12
## 3 2000-01-31    1.799939e-02    0.4510484749      sc1       11
## 4 2000-01-31    1.812843e-02    0.4539609053      sc1       10
## 5 2000-01-31    1.865092e-02    0.0001878219      sc1        4
## 6 2000-01-31    1.890661e-05    0.0085302987      sc1        3

P, N y Caudal

En la imagen, donde los channels estan en azul y la subcuenca en negro, se nota que no están incluidos todos los channels.

Canales y Subcuencas del archivo hru2.shp

Escenarios:

  1. Rot 1 y 6 con riego al 80%
  2. Rot 1 y 6 con riego al 95%
  3. Rot 1 y 6 con riego al 40%
  4. Rot 1 con riego al 80%
  5. Rot 1 con riego al 95%
  6. Rot 1 con riego al 40%
  7. Rot 6 con riego al 80%
  8. Rot 6 con riego al 95%
  9. Rot 6 con riego al 40%
  10. Base sin riego
plotly::ggplotly(
ggplot(env_results, aes(x=scenario, y=P_Concentration))+
  geom_boxplot()+
  facet_wrap(~subbasin,scales = "free_y")+
  scale_y_continuous(limits = quantile(env_results$P_Concentration, c(0.10, 0.90)))+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))
)
plotly::ggplotly(
ggplot(env_results, aes(x=scenario, y=N_Concentration))+
  geom_boxplot()+
  facet_wrap(~subbasin,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))+
  scale_y_continuous(limits = quantile(env_results$N_Concentration, c(0.10, 0.90)))
)
plotly::ggplotly(
ggplot(env_results, aes(x=scenario, y=flo_out))+
  geom_boxplot()+
  facet_wrap(~subbasin, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))+
  scale_y_continuous(limits = quantile(env_results$flo_out, c(0.10, 0.90)))
)

Salidas

Notar que el nivel permitido por dinama es de hasta 0.25 mg/L en P y 10 mg/L en N. A continuación los resultados por canal y subcuenca.

Los resultados solo por subcuenca son los siguientes:

Riego

El primer grafico muestra todos con la misma escala para detectar cuales son los años con mas riego. El resto estan por escala de cada año.

irr_yr <- 
  readRDS("C:/Users/Usuario/Desktop/Git/Tesis/San_Salvador/Data_Simulaciones_Eco/irr_yr.RDS")

irr_yr<-
  irr_yr %>% plyr::join(hru_info, by="hru")

irr_yr %>% head
## # A tibble: 6 x 9
## # Groups:   hru [1]
##     hru yr    irr_sum irr_cost scen   area lu_mgt    Rotacion_riego Subbasin
##   <dbl> <chr>   <dbl>    <dbl> <chr> <dbl> <chr>              <dbl>    <dbl>
## 1    11 2000       64     41.6 sc1    7.34 agrc3_lum              1        1
## 2    11 2001       32     20.8 sc1    7.34 agrc3_lum              1        1
## 3    11 2005       96     62.4 sc1    7.34 agrc3_lum              1        1
## 4    11 2007       32     20.8 sc1    7.34 agrc3_lum              1        1
## 5    11 2008      160    104   sc1    7.34 agrc3_lum              1        1
## 6    11 2009       96     62.4 sc1    7.34 agrc3_lum              1        1
ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum))+
  geom_boxplot()+
  facet_wrap(~Subbasin)+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum))+
  geom_boxplot()+
  facet_wrap(~yr,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum))+
  geom_boxplot()+
  facet_wrap(~Subbasin,scales = "free_y" )+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum))+
  geom_boxplot()+
  facet_wrap(~yr,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum))+
  geom_boxplot()+
  facet_wrap(~Rotacion_riego, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost))+
  geom_boxplot()+
  facet_wrap(~Subbasin,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost))+
  geom_boxplot()+
  facet_wrap(~yr,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost))+
  geom_boxplot()+
  facet_wrap(~Rotacion_riego, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum/area))+
  geom_boxplot()+
  facet_wrap(~Subbasin, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum/area))+
  geom_boxplot()+
  facet_wrap(~yr,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_sum/area))+
  geom_boxplot()+
  facet_wrap(~Rotacion_riego, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost/area))+
  geom_boxplot()+
  facet_wrap(~Subbasin, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost/area))+
  geom_boxplot()+
  facet_wrap(~yr,scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

ggplot(irr_yr %>% filter(!is.na(Subbasin)), aes(x=scen, y=irr_cost/area))+
  geom_boxplot()+
  facet_wrap(~Rotacion_riego, scales = "free_y")+
  theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))

Precipitacion

plotly::ggplotly(
ggplot(env_results %>% filter(scenario=="sc1") %>% filter(id==1) , aes(x=yr,y=precip))+
  geom_bar(stat="identity")+
  coord_flip()
)
plotly::ggplotly(
ggplot(env_results %>% mutate(estacion=case_when(mon=="1" | mon=="2" | mon=="3"~"Verano", mon=="4" | mon=="5" | mon=="6"~"Otonio", mon=="7" | mon=="8" | mon=="9"~"Invierno", mon=="10" | mon=="11" | mon=="12"~"Primavera" )) ,
       aes(x=yr,y=precip))+
  geom_bar(stat="identity")+
  facet_wrap(~estacion,scales = "free_y")+
  #+  facet_wrap(~estacion,scales = "free_y")+
    theme(axis.text.x =element_text(angle=90,
                                  hjust=1),
        text = element_text(size=12))
  
)